home *** CD-ROM | disk | FTP | other *** search
/ VisualFX for ImageFX / VisualFX for Image FX 2 - Disc 2.iso / arexx / 01 / 01.rexx
Encoding:
OS/2 REXX Batch file  |  1997-02-11  |  4.6 KB  |  235 lines

  1. /*
  2.                           Visual FX Arexx Script
  3.                            Written By J.L. White
  4.                          (C)1997 Merlin's Software
  5. */
  6.  
  7. Options Results
  8. address "IMAGEFX.1"
  9. ScreenToFront
  10. Undo Off
  11. if exists("libs:flyer.library") then do
  12.     TOASTERLIB="ToasterARexx.port"
  13.     call remlib('ToasterARexx.port')
  14.     call remlib('PROJECT_REXX_PORT')
  15.     call addlib('PROJECT_REXX_PORT' , 0)
  16.     call addlib(TOASTERLIB,0)
  17.     end
  18. call Settings()
  19. j=0
  20. TFrames = Frames
  21. if Field = 1 then TFrames = Frames*2
  22. do i = 1 to Frames
  23.     call open TempFile,"RAM:VFXNums",W
  24.     call writeln TempFile,right(i,5,'0')
  25.     call writeln TempFile,right(Frames,5,'0')
  26.     call close TempFile
  27.     f=0
  28.     Redraw Off
  29.     FieldSet = 0
  30.     if Padding ~= -1 & i = 1 then call PadIt(1)
  31.     call LoadB()
  32.     call LoadA()
  33.     j = j+ 1
  34.     call DoIt()
  35.     Redraw On
  36.     call SaveIt()
  37.         if Field = 1 then do
  38.             Redraw Off
  39.             FieldSet = 1
  40.             call LoadB()
  41.             call LoadA()
  42.             j = j + 1
  43.             call DoIt()
  44.             Redraw On
  45.             call SaveIt()
  46.             end 
  47.     if Padding ~= -1 & i = Frames then call PadIt(2)
  48.     end
  49.     if SaveType = 0 then do
  50.         if Padding = -1 then
  51.             call MakeIcon(SaveName,(Frames-10))
  52.         else
  53.             call MakeIcon(SaveName,(Padding+(Frames-10)))
  54.         end
  55.     Undo On
  56. exit
  57.  
  58.  
  59. PadIt:
  60. arg PadNum
  61.     if (POS('FLY_1',SHOW('Ports')) = 0) then do
  62.         Undo On
  63.         exit
  64.         end
  65.          if PadNum = 1 then do
  66.        if IAType = 0 then do
  67.         do Pad = Padding to 1 by -1
  68.             LoadBuffer PicAName Force StartA-(Pad-1)
  69.             call Switcher(TOSW)
  70.             call Switcher(MDV1)
  71.             Render Go
  72.                 call RecordAdd(SaveName,2,6,Compression)
  73.             end
  74.         end
  75.        if IAType = 1 then do
  76.         LoadBuffer PicAName Force 1
  77.         call Switcher(TOSW)
  78.         call Switcher(MDV1)
  79.         Render Go
  80.             call RecordAdd(SaveName,2*Padding,6,Compression)
  81.         end
  82.        if IAType = 2 then do
  83.         LoadBuffer PicAName Force
  84.         call Switcher(TOSW)
  85.         call Switcher(MDV1)
  86.         Render Go
  87.             call RecordAdd(SaveName,2*Padding,6,Compression)
  88.         end
  89.        if IAType = 3 then do
  90.         do Pad = Padding to 1 by -1
  91.             LoadBuffer PicAName""right(StartA-(Pad-1),3,'0') Force
  92.             call Switcher(TOSW)
  93.             call Switcher(MDV1)
  94.             Render Go
  95.                 call RecordAdd(SaveName,2,6,Compression)
  96.             end
  97.         end
  98.     end 
  99.     else do
  100.        if IBType = 0 then do
  101.         do Pad = 1 to Padding
  102.             LoadBuffer PicBName Force StartB+Pad+TFrames
  103.             call Switcher(TOSW)
  104.             call Switcher(MDV1)
  105.             Render Go
  106.                 call RecordAdd(SaveName,2,6,Compression)
  107.             end
  108.         end
  109.        if IBType = 1 then do
  110.         LoadBuffer PicBName Force 1
  111.         call Switcher(TOSW)
  112.         call Switcher(MDV1)
  113.         Render Go
  114.             call RecordAdd(SaveName,2*Padding,6,Compression)
  115.         end
  116.        if IBType = 2 then do
  117.         LoadBuffer PicBName Force
  118.         call Switcher(TOSW)
  119.         call Switcher(MDV1)
  120.         Render Go
  121.             call RecordAdd(SaveName,2*Padding,6,Compression)
  122.         end
  123.        if IBType = 3 then do
  124.         do Pad = 1 to Padding
  125.             LoadBuffer PicBName""right(StartB+Pad+TFrames),3,'0') Force
  126.             call Switcher(TOSW)
  127.             call Switcher(MDV1)
  128.             Render Go
  129.                 call RecordAdd(SaveName,2,6,Compression)
  130.             end
  131.         end
  132.     end
  133. return
  134.  
  135.  
  136. LoadA:
  137.     if (POS('FLY_1',SHOW('Ports')) = 0) then do
  138.         Undo On
  139.         exit
  140.         end
  141.     if j = TFrames then return
  142.     if IAType = 0 then do
  143.         LoadBuffer PicAName Force i+StartA
  144.         end
  145.     if IAType = 1 then do
  146.         LoadBuffer PicAName Force 1
  147.         end
  148.     if IAType = 2 then do
  149.         LoadBuffer PicAName Force
  150.         end
  151.     if IAType = 3 then do
  152.         LoadBuffer PicAName""right(i+StartA,3,'0') Force
  153.         end
  154.  
  155. return
  156.  
  157. LoadB:
  158.     if (POS('FLY_1',SHOW('Ports')) = 0) then do
  159.         Undo On
  160.         exit
  161.         end
  162.     if j = 1 then return
  163.     if IBType = 0 then do
  164.         LoadBuffer PicBName Force i+StartB
  165.         end
  166.     if IBType = 1 then do
  167.         LoadBuffer PicBName Force 1
  168.         end
  169.     if IBType = 2 then do
  170.         LoadBuffer PicBName Force
  171.         end
  172.     if IBType = 3 then do
  173.         LoadBuffer PicBName""right(i+StartB,3,'0') Force
  174.         end
  175.     Swap
  176. return
  177.  
  178.  
  179. DoIt:
  180.     if (POS('FLY_1',SHOW('Ports')) = 0) then do
  181.         Undo On
  182.         exit
  183.         end
  184.     if j = TFrames then do
  185.         Swap
  186.         return
  187.         end
  188.     if j = 1 then return
  189.  
  190.     Num = (((j-1) * 100)/(TFrames-1))
  191.     Num = trunc(Num)
  192.     Hook Composite MERGE Num 1 0 0 MatchMain SwapScale
  193. return
  194.  
  195. SaveIt:
  196.     if (POS('FLY_1',SHOW('Ports')) = 0) then do
  197.         Undo On
  198.         exit
  199.         end
  200.     if SaveType = 0 then do
  201.         call Switcher(TOSW)
  202.         call Switcher(MDV1)
  203.  
  204.         Render Go
  205.         if Field = 1 then
  206.                 call RecordAdd(SaveName,1,6,Compression)
  207.         else
  208.                 call RecordAdd(SaveName,2,6,Compression)
  209.         end
  210.  
  211.     if SaveType = 1 then do
  212.         if Field = 1 then do
  213.             f= f + 1
  214.             if f = 1 then
  215.                 SaveBufferAs ILBM "RAM:PicA"
  216.             if f = 2 then do
  217.                 GetMain
  218.                 parse var result Name Width Height Blah
  219.                 Scale Width Height/2
  220.                 Swap
  221.                 LoadBuffer "RAM:PicA" Force
  222.                 Scale Width Height/2
  223.                 Hook Interlace
  224.                 SaveBufferAs ILBM SaveName""right(i,3,'0')
  225.                 f = 0
  226.                 end
  227.             end
  228.         else do
  229.             SaveBufferAs ILBM SaveName""right(i,3,'0')
  230.             end    
  231.         end
  232. return
  233.  
  234.  
  235.